﻿<link href="@Url.Content("~/content/activitie_detail.css")" rel="stylesheet" type="text/css"/>
<link href="@Url.Content("~/content/table_btn.css")" rel="stylesheet" type="text/css"/>

<!--[if lt IE 8]>
    <link href="@Url.Content("~/content/activitie_create.css")" rel="stylesheet" type="text/css"/>
<![endif]-->

<noscript>
    <link href="@Url.Content("~/content/activitie_create.css")" rel="stylesheet" type="text/css"/>
    <link href="@Url.Content("~/content/activitie_noscript.css")" rel="stylesheet" type="text/css"/>
</noscript>

@model IEnumerable<PessModel.Rule>

@{
    ViewBag.Title = "Details";
}

<h2>Rule Details</h2>
<div id="operate" class="fromSubject">
    @Html.ActionLink("Back", "Index", new {activityID=ViewBag.ActivityID },null)

    @if ((bool)ViewBag.ShowCreateRuleButton)
    {
        @Html.ActionLink("New", "Create", new {subjectID=ViewData["SubjectID1"] },null)
        if (Roles.IsUserInRole("Admin") || Roles.IsUserInRole("Chair"))
        {
            using(Html.BeginForm("CopyRulesFromSubject","Rule",FormMethod.Post)){
                <input type="submit" value="Import" />
                @Html.DropDownList("SubjectID",(SelectList)ViewBag.SubjectID)
                <span>Import Rules from：</span>
                @Html.Hidden("TargetSubjectID",(int)ViewData["subjectID1"])
            }
        }
    }
</div>
<fieldset>
    <legend>@ViewBag.SubjectName</legend>
<div class="displayValue">
    <table>
        <tr>
            @*<th>
                @Html.DisplayNameFor(model => model.SubjectID)
            </th>*@
            <th>
                @*@Html.DisplayNameFor(model => model.Name)*@Name
            </th>
            <th>
                @*@Html.DisplayNameFor(model => model.Description)*@Description
            </th>
            <th>
                @*@Html.DisplayNameFor(model => model.Value)*@Score
            </th>
            <th></th>
        </tr>

    @foreach (var item in Model) {
        <tr>
            @*<td>
                @Html.DisplayFor(modelItem => item.SubjectID)
            </td>*@
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Description)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Value)
            </td>
            <td>
                @if (Roles.IsUserInRole("Admin") || Roles.IsUserInRole("Chair") || (bool)ViewBag.ShowCreateRuleButton)
                {
                    @Html.ActionLink("Edit", "Edit", new { ruleID=item.ID }) 
@*                @Html.ActionLink("详细", "Details", new { id=item.ID }) |*@
                    @Html.ActionLink("Delete", "Delete", new { ruleID=item.ID })
                }
            </td>
        </tr>
    }
    </table>
</div>
    </fieldset>